import { createStore } from "vuex";

import moduleA from './modules/moduleA'
import moduleB from './modules/moduleB'


const store = createStore({
modules:{
    a:moduleA,
    b:moduleB
},

    state() {
        return{
            count:9
        }
    },
    getters:{
        tenTimes:(state) => {
            return state.count * 9
        }
    },
    mutations:{
        increment(state,playload) {
            state.count = playload.count
        }
    },
    actions:{
        asyncIncrement(context,playload){
            context.commit('increment',playload)
        }
    }
})

export default store;